import numpy as np
import pandas as pd

rng = pd.date_range('1/1/2012', periods=5, freq='M')

# 年月日展示
ts = pd.Series(np.random.randn(len(rng)), index=rng)
print(ts)
print("-" * 22)

# 年月展示
ps = ts.to_period()
print(ps)
print("-" * 22)

# 年月日展示
ps = ps.to_timestamp()
print(ps)
